<template>
    <div>
        <a href="http://localhost:8081/" style="font-size: 20px">首页</a>
        <div style="display: flex;justify-content: center;margin-top: 150px">
            <el-card style="width: 400px">
                <div slot="header" class="clearfix">
                    <span>登录</span>
                </div>
                <table>
                    <tr>
                        <td>用户名</td>
                        <td>
                            <el-input v-model="loginForm.staffAcount" placeholder="请输入运营人员账号"></el-input>
                        </td>
                    </tr>
                    <tr>
                        <td>密码</td>
                        <td>
                            <el-input type="password" v-model="loginForm.staffPassword" placeholder="请输入密码" @keydown.enter.native="doLogin"></el-input>
                        </td>
                    </tr>
                    <tr>
                        <td colspan="2">
                            <el-button style="width: 300px" type="primary" @click="doLogin">登录</el-button>
                        </td>
                    </tr>
                </table>
            </el-card>
        </div>
    </div>
</template>

<script>
    export default {
        data() {
            return{
                loginForm:{
                    staffAcount:'',
                    staffPassword:'',
                }
            }
        },
        methods:{
            doLogin(){
                this.$cookie.set('staffAcount',this.loginForm.staffAcount);
                this.$message('登录成功！欢迎您，'+this.loginForm.staffAcount);
                this.$router.push({
                    path: '/StaffIndex',
                })
            }
        }
    }
</script>

<style scoped>

</style>
